<?php
/**
 # mod_megascrollnews - Mega Scroll News Module for Joomla! 1.7
 # author 		OmegaTheme.com
 # copyright 	Copyright(C) 2011 - OmegaTheme.com. All Rights Reserved.
 # @license 	http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 # Website: 	http://omegatheme.com
 # Technical support: Forum - http://omegatheme.com/forum/
**/
/**------------------------------------------------------------------------
 * file: default.php 1.7.0 00001, March 2011 12:00:00Z OmegaTheme $
 * package:	 Mega Scroll News Module
 *------------------------------------------------------------------------*/
//No direct access!
defined('_JEXEC') or die; ?>
<div id="megascroller-wrap" class="megascroller<?php echo $params->get('moduleclass_sfx'); ?>">
	<div id="module-title"><?php echo $params->get('mega-title','Latest News'); ?></div>
	<div id="mega-nav">
		<a id="go-prev"  href="javascript: void(0)"></a>
		<a id="go-next"  href="javascript: void(0)"></a>
	</div>
	<div class="mega-item" id="ticker">
		<div id="ticker-slideshow" class="slideshow">
			<?php foreach ($list as $item) :  ?>
				<a class="item" href="<?php echo $item->link; ?>">
					<?php echo $item->title; ?></a>
			<?php endforeach; ?>
		</div>
	</div>
</div>
<script type="text/javascript">
<!--
window.addEvent('domready', function() {
	var opt = $('ticker-slideshow');
	var scroller = new SlideShow(opt, {
		transition: 'pushRight',
		duration: <?php echo $params->get('duration', 1000); ?>,
		delay: <?php echo $params->get('delay', 3000); ?>,
		autoplay: <?php echo $params->get('autoplay', 1); ?>
	}, true);
	scroller.setup();
	document.id('go-prev').addEvent('click', function() {
		scroller.pause();
		if(scroller.index > 0){
			scroller.index-=1;
		}else{
			scroller.index =  scroller.slides.length-1;
		}
		scroller.show(scroller.index);
		scroller.play();
	});
	document.id('go-next').addEvent('click', function() {
		scroller.pause();
		if(scroller.index < scroller.slides.length-1){
			scroller.index+=1;
		}else{
			scroller.index = 0;
		}
		scroller.show(scroller.index);
		scroller.play();
	});
	// some usability considerations
	opt.addEvents((function(){
		var timer;
		return {
			mouseenter: function(){
				clearTimeout(timer);
				scroller.pause();
			},
			mouseleave: function(){
				timer = (function(){
					scroller.show('next').play()
				}).delay(1500);
			}
		}
	}()));
});
-->
</script>
<!--End-->